package com.wuren.faceSwiping.aboutUs.controller;

import com.wuren.faceSwiping.aboutUs.entity.CooperationMessage;
import com.wuren.faceSwiping.aboutUs.service.CooperationMessageService;
import com.wuren.faceSwiping.helper.vo.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/aboutUs/cooperationmessage")
@CrossOrigin("*")
public class CooperationMessageController {
    @Autowired
    private CooperationMessageService cooperationMessageService;
    /**
     * 查所有信息
     * @return
     */
    @RequestMapping("/findAll")
    public ResponseBean findAll(){
       return new ResponseBean(200,1,cooperationMessageService.findAll());
    }
    /**
     * 新增留言
     * @param cooperationMessage  留言属性
     * @return
     */
    @RequestMapping("/add")
    public ResponseBean add(CooperationMessage cooperationMessage){
        return new ResponseBean(200,1,cooperationMessageService.add(cooperationMessage));
    }
    /**
     * 删除留言
     * @param cid 留言id
     * @return
     */
    @RequestMapping("/delete")
    public ResponseBean delete( int cid){
        return new ResponseBean(200,1,cooperationMessageService.removeById(cid));
    }
}
